package org.springboot3.project.web.controller;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springboot3.project.web.forest.Demo3Body;
import org.springboot3.project.web.forest.Demo3Item;
import org.springboot3.project.web.forest.DemoResponse;
import org.springboot3.project.web.forest.ForestClientForDemo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

@RestController
public class TestForeatController {

    private static final Logger log = LoggerFactory.getLogger(TestForeatController.class);

    @Autowired
    private ForestClientForDemo forestClientForDemo;


    @GetMapping("/forestTest")
    public String forestTest(){
        Demo3Body body = new Demo3Body();
        body.setKey("k1");
        body.setValue("v3456");

        DemoResponse<Demo3Item> demo3Response = forestClientForDemo.demo3Request("http://172.16.22.22:17203/open/api/demo3", body);
        return JSON.toJSONString(demo3Response);
    }
}
